module.exports = function($scope, obj, $modalInstance, list, findByorderCartCode){

    $scope.obj = obj;
    /* 分页 * ========================================= */
    $scope.maxSize = 5;            //最多显示多少个按钮
    $scope.bigCurrentPage = 1;      //当前页码
    $scope.itemsPerPage = 10;         //每页显示几条

    /* 退款分页 * ========================================= */
    $scope.maxSize1 = 5;            //最多显示多少个按钮
    $scope.bigCurrentPage1 = 1;      //当前页码
    $scope.itemsPerPage1 = 10;         //每页显示几条
    $scope.infoobj = []
    
    $scope.load = function () {
      var para = {
        'pageNo': $scope.bigCurrentPage,
        'pageSize': $scope.itemsPerPage,
        'order_cart_code': $scope.obj.code
      }
    	list.save(para, function(res){
        if(res.errcode === 0) {
            $scope.objs = res.data.results ;
            $scope.bigTotalItems = res.data.totalRecord;
        } else {
            alert(res.errmsg);
        }
      });
    };
    $scope.load();
    $scope.loadInfo = function () {
      var para = {
        'order_cart_code': $scope.obj.code
      }
    	findByorderCartCode.save(para, function(res){
        if(res.errcode === 0) {
            $scope.infoobj[0] = res.data;
            console.log($scope.infoobj, '#####')
            $scope.backobj = res.data.payRefundList;
        } else {
            alert(res.errmsg);
        }
      });
    };
    $scope.loadInfo();
    $scope.ok = function () {
    	//alert('ok');
    	$modalInstance.close();
    };

    $scope.cancel = function () {
    	$modalInstance.close();
    }

};